//! TODO: This class requires a redesign / refactor / cleanup.
//!
//!



#pragma once

#include <CEGUI/CEGUI.h>
#include <OgreCEGUIRenderer.h>

//! Inheritable class. Objects which should inherit from it are those which
//! own a CEGUI user interface.
//!
//! @remark The usage of this class isn't as encapsulated as we may wish, so using
//! it implies certain compromises for the user which extends it. User should call
//! InitializeCEGUI after creating his scene and to have the Ogre scene manager
//! ready. Also, he should call CleanCEGUI when exiting the state, but BEFORE
//! destroying the scene manager.
class CEGUIOwner
{
	CEGUI::OgreCEGUIRenderer * mGUIRenderer;
	CEGUI::System * mGUISystem;

protected:

	//! Creates a CEGUIOwner object.
	//!
	CEGUIOwner();

	//! Destroys a CEGUIOwner object.
	//!
	~CEGUIOwner();

public:

	//! Cleans CEGUI.
	//!
	void CleanCEGUI();

	//! Returns a pointer to the renderer.
	//!
	CEGUI::OgreCEGUIRenderer * GetGUIRenderer();

	//! Returns a pointer to the CEGUI system.
	//!
	CEGUI::System * GetGUISystem();

	//! Initializes the system and the CEGUI renderer. Required for using
	//! most GUI functionality.
	//!
	void InitializeCEGUI(Ogre::RenderWindow * win, Ogre::SceneManager * mgr);

	//! Activates or deactivates the mouse cursor.
	//!
	void ActivateMouseCursor(bool activar);

};
